/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package svp;

import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JRootPane;

/**
 *
 * @author kandamaran
 */
public class OnError {
    SVPAboutBox aboutBox = new SVPAboutBox(SVPApp.getApplication().getMainFrame());
    
    public void sendError(String errorMessage,Exception e, JRootPane rootPane){
    
    rootPane.setFocusable(false);   
    int newType = JOptionPane.showConfirmDialog(rootPane,errorMessage,"Error",JOptionPane.YES_NO_OPTION);
    
    if (newType == JOptionPane.YES_OPTION){
      String com = aboutBox.sendReport(e);
      JOptionPane.showMessageDialog(rootPane, com);
    }        
    }
    
}
